<?php
include("../admin/sesiune.php");
$username = $_SESSION["username"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Home</title>
</head>
<body>
<?php
$loginresult = login($_POST['username'],$_POST['password']);
$accessQ = "SELECT access FROM user where username  = '{$_SESSION["username"]}'";
$runQuery = mysql_query ($accessQ, getConnection()) or die (mysql_error());
$result = mysql_fetch_assoc($runQuery);

	if($result['access'] == 2)
		{
		echo "<a href='../admin/adminPage.php'>Control Panel</a>";
		}

	elseif($result['access'] != 2)
		{
		echo "&nbsp;";
		}
?>
<p align="right"><?php 
if(isset($_SESSION["username"]))
{
echo "You are logged in as $username!";
}
else
{
echo "You are not logged in!";
}
?></p>
<table>
	<tr>
		<td><a href="food.php"><img alt="food" src="../images/food.png"></a></td>
		<td><a href="drinks.php"><img alt="drinks" src="../images/drinks.png"></a></td>
	</tr>
	<tr>
		<td><a href="clothes.php"><img alt="clothes" src="../images/pants.png"></a></td>
		<td><a href="shoes.php"><img alt="shoes" src="../images/shoes.png"></a></td>
	</tr>
</table>
</body>
</html>
